STEP 1.0 : A Debugging Tool for use with XLISP 1.4
30 March 1985
by
Gregory Frascadore
(frascado%umn-cs.CSNET)
(75106,662 on COMPUSERVE)
INTRODUCTION
STEP is a debugging tool that allows you to set breakpoints and/or
single step through the evaluation of a lisp program. With STEP you can
interactively debug lisp programs in a manner similar to the debugging of
object code programs using debuggers like DDT, Macsbug, etc.
This document describes STEP's commands and provides some examples of
usage. Since STEP is distributed in source code form you can modify it to
your liking and of course fix any bugs you may (will) find. If you do make
any great changes, I would appreciate hearing about them so that I could
incorporate them into future versions of STEP.
ENVIRONMENT
STEP was designed to operate with XLISP 1.4 . It should be easy to
adapt STEP to work with other lisps since XLISP 1.4 is similar to CommonLisp. STEP will almost certainly have to be modified to work with later versions
of XLISP.
LOADING STEP
In order to function correctly, STEP requires the availability of the
functions defined in STEPLIB.LSP. Probably the best way to make sure STEPLIB
is loaded is to place a (load "STEPLIB.LSP") in your INIT.LSP file. This
will not only insure that STEPLIB is available for use by STEP, but will
also allow you to use the "autoload" macro defined in STEPLIB to load STEP.
The best way to load STEP is to place an (autoload step STEP10) in your
INIT.LSP file after the (load "STEPLIB.LSP). The autoload will not actually
load STEP. Instead, STEP will be loaded the first time you make a call to it
using the "step" function described later. This deferred loading scheme helps
minimize wasting memory by only loading STEP when you need it. You can also
use autoload to "load" any other utility packages you may have.
If for some reason you want STEP loaded all the time, just place a
(load "STEP10.LSP") in your INIT.LSP file.
If you have a small memory computer like a 128k Macintosh, you may
have to do an XLISP (expand) before loading.
FUNCTIONS
There are only two functions in the STEP package that are called by
the user: step and nostep.
(step [<atom>]...) ACTIVATES STEP AND OPTIONALLY SETS BREAKPOINTS
<atom> specifying one or more <atom>s causes stepping to begin
when STEP encounters one of the <atom>s as the car of a
list being evaluated. Providing <atom>s to the "step"
function is analogous to setting breakpoints with an
object code debugger. NOTE the <atom>s are NOT quoted.
If no <atom>s are specified to the step function, STEP
will start stepping when the next list is evaluated.
Calling the step function a second time resets STEP and/or
restores stepping after a call to nostep.
returns t always.
Examples:
(step) -turns on stepping at next list evaluation.
(step 'cond) -stepping begins at first call to 'cond'.
(step 'if 'let) -stepping begins at first call to 'if' or
'let' whichever comes first.
(nostep) TURNS OFF STEPPING
NOTE: When turning off stepping with "nostep", STEP will actually walk
you through the execution of nostep. If you want to avoid this
use the "n" command (described below) in responce to the >> prompt.
DO NOT use the "g" command as this will undo the nostep.
returns t always.
COMMANDS
Once interactive stepping begins, STEP prompts you for a command before
the evaluation of every list (atoms are evaluated and their values returned
without prompting for commands). There are 13 possible commands you can give
to STEP when you see the >> prompt:
? - help. Gives you a brief summary of commands.
h - help. Same as ?
s - step. Make a single step.
# - step # times. Makes # steps where # is a positive integer.
e - exit. Abort the current evaluation and return t.
q - quit. Same as e except q also does a (nostep).
x - exit. Same as e.
b - break. Enters an XLISP break loop using the (break) function.
c - continue. Continue execution until next breakpoint is
encountered.
g - go. Continue evaluations without any further interruptions
by set breakpoints.
n - nodeeper. Lets you avoid deep grungy details.
+ <atom> - adds the atom to the list of breakpoints.
- <atom> - removes the atom from the list of breakpoints.
BUGS/DEFICIENCIES
o STEP will not step into functions called by apply or funcall.
o Program execution is slower than without STEP. The more breakpoints
that are set the slower things get. Use of the g and n commands
will speed things up when you don't want to step any more through
the current evaluation.
o STEP eats up memory and stack and is almost impossible to use on a
128k macintosh. Other small memory computers may have similar problems.
You may have to do an (expand) before loading STEP.
o STEP steps through the execution of nostep and use of the "g" command
will immediately undo the effects of nostep. Use the "n" command